php forum
php mysql forum
php mysql smarty
 
Topic Options
#232687 - 01/11/03 08:54 AM [6.2] Generic Header template mod
Dalantech Offline
Junior Member

Registered: 02/11/01
Posts: 2392
Loc: Naples, Italy
What does it do? It allows you to use a "Threads like" template for you generic header. <br /> <br />Why would you care?: Because you can take advantage of the new $tbopen and $tbclose variables in Threads 6.2... <br /> <br />Who gets the props?: Me <img src="/forum/images/graemlins/smile.gif" alt="" /> (But I also have to give a nod to JustDave <img src="/forum/images/graemlins/smile.gif" alt="" /> ) <br /> <br />Here is the script for your Generic Header: <br /> <br />
Code:
 <br /> <br /> &lt;? <br /> <br />$html = new html; <br /> <br />// Grab the tablewrapper <br />list($tbopen,$tbclose) = $html -&gt; table_wrapper(); <br /> <br />// Send the template <br />include("$thispath/templates/$tempstyle/header.tmpl"); <br /> <br />?&gt; <br /> <br /> 
<br /> <br />You also have to create a header.tmpl file and copy it to your ubbthreads/templates/default/ directory. Here is a simplified version of my header.tmpl file: <br /> <br />
Code:
 <br /> &lt;? <br />echo &lt;&lt;&lt;template <br /> <br />$tbopen <br /> <br />&lt;tr&gt; <br />&lt;td class="darktable"&gt; <br />&lt;table border="0" cellpadding="0" cellspacing="0"&gt; <br /> <br />&lt;tr&gt; <br />  &lt;td class="logo-left"&gt;&lt;img border="0" src="http://www.yourdomain.com/logo-clear.gif" width="250" height="60" /&gt; <br />&lt;/td&gt; <br /> <br />&lt;td class="logo" width="100%" align="right"&gt; <br />&lt;/td&gt; <br /> <br />&lt;/tr&gt; <br /> <br />&lt;/table&gt; <br />&lt;/td&gt; <br />&lt;/tr&gt; <br /> <br />$tbclose <br /> <br />&lt;br /&gt; <br /> <br />template; <br />?&gt; <br /> <br /> 
<br /> <br />Since the last html tag in the tbopen.tmpl file is a table, all you have to do in your header.tmpl file after $tbopen is start out with a tr and a td tag. <br /> <br />The benefit to doing your header this way: If you ever change the tbopen or tbclose template files your header will automatically change... <br /> <br />P.S. Try this out on a forum header first. I have a test forum that I use to test new designs that only admins and mods can see.


Edited by Dalantech (01/21/03 07:29 AM)
_________________________
Da LAN Tech

Threads Dev Moderator

Top
#232688 - 01/11/03 09:44 AM Re: Generic Header templte mod [Re: jacksonm99]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
Sweet! <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />I got to playing and did things this way... (figures huh?) <img src="/forum/images/graemlins/wink.gif" alt="" /><br /><br />In your ubbt.inc.php file around line 377 find this:<br /><br />
Code:
<br />         // -------------------------------------------<br />         // Now require the registerednav.php template<br />            $html = new html;<br />            list($tbopen,$tbclose) = $this -&gt; table_wrapper();<br />
<br /><br />and change it to this:<br /><br />
Code:
<br />         // -------------------------------------------<br />         // Now require the registerednav.php template<br />
<br /><br /><br />Around line 200 find this:<br /><br />
Code:
<br />      if (isset($user['loggedout'])) {<br />         $loggedout = $user['loggedout'];<br />      }<br />
<br /><br />and change it to this:<br /><br />
Code:
<br />      if (isset($user['loggedout'])) {<br />         $loggedout = $user['loggedout'];<br />      }<br />	  <br />      $html = new html;<br />      list($tbopen,$tbclose) = $this -&gt; table_wrapper();<br />
<br /><br /><br /><br />Change your header.php file located in your includes directory to something like this:<br /><br />
Code:
<br />&lt;?<br />echo &lt;&lt;&lt;UBBTPRINT<br />$tbopen<br />&lt;tr&gt;<br />&lt;td align="left" class="welcome"&gt;<br /><br />Your Logo Here. (or what ever)<br />&lt;/td&gt;<br />&lt;/tr&gt;<br />$tbclose<br />UBBTPRINT;<br />?&gt;<br />
<br /><br /><br /><br />Either way should work but this way will allow for forum specific headers to be used easily. <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
~Dave
ChattersOnline.com

Top
#232689 - 01/11/03 09:49 AM Re: Generic Header templte mod [Re: sjsaunders]
Dalantech Offline
Junior Member

Registered: 02/11/01
Posts: 2392
Loc: Naples, Italy
Very <img src="/forum/images/graemlins/cool.gif" alt="" /> !
_________________________
Da LAN Tech

Threads Dev Moderator

Top
#232690 - 01/21/03 01:04 AM Re: Generic Header template mod [Re: jacksonm99]
Dalantech Offline
Junior Member

Registered: 02/11/01
Posts: 2392
Loc: Naples, Italy
JustDave,<br /><br />I can't edit my original file. Would you please add [6.2] to the title of the first post? I forgot to do it, and this mod is Threads version specific. Thanks! <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
Da LAN Tech

Threads Dev Moderator

Top
#232691 - 01/21/03 05:20 AM Re: Generic Header template mod [Re: jacksonm99]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
Nice work Dalantech love it! <br /><br /> However just a quick note to users who would download this hack. If you have software programs like Photopost integrated with Threads make sure to copy your header.php file over into the photopost directory and rename it something like header.html and call it from there. External programs will not read the $tbopen and $tbclose variables. I found out the hard way when I was scratching my head wondering why photopost was not working and remembered I applied this hack a day earlier. I think it worthwhile to go the extra step and do this hack as everything is going to templates eventually. Most programs will separate the code and html so in the future you will be able to integrate them directly again. It is nothing to copy the contents to a file named header.html when you have to make one names header.tmpl anyway.
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#232692 - 01/21/03 06:08 AM Re: Generic Header template mod [Re: sf49rminer]
Dalantech Offline
Junior Member

Registered: 02/11/01
Posts: 2392
Loc: Naples, Italy
Did you try requiring the Threads library from within the photo posts php file? Not sure if it would work, but it might be worth a try.
_________________________
Da LAN Tech

Threads Dev Moderator

Top
#232693 - 01/21/03 06:33 AM Re: Generic Header template mod [Re: jacksonm99]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
I added this forum to the list of forums with unlimited edit time. You should be able to edit now. <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
~Dave
ChattersOnline.com

Top
#232694 - 01/21/03 07:29 AM Re: Generic Header template mod [Re: sjsaunders]
Dalantech Offline
Junior Member

Registered: 02/11/01
Posts: 2392
Loc: Naples, Italy
<img src="/forum/images/graemlins/cool.gif" alt="" /><br /><br />Done <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
Da LAN Tech

Threads Dev Moderator

Top
#232695 - 01/21/03 10:51 AM Re: Generic Header templte mod [Re: sjsaunders]
Dalantech Offline
Junior Member

Registered: 02/11/01
Posts: 2392
Loc: Naples, Italy
I got to turning this whole thing over in my head, and as usual I was doing site design / scripting while I was driving home. This was one of theose days when I'm realy glad the car knew how to get home...<br /><br />Since Threads alows for forum specific headers why not create a header for each forum using the php script that I put in the first post of this thread, but set it up so that it includes a different template for each forum. Since the graphics are set by CSS properties it would be a piece of cake to define different logos per forum (it would only require one new class per forum in every style sheet). Style sheet selection checking isn't needed in the header (it's obviously checked before the header includes).<br /><br />So it's possible to have forum specific logos without any additional script hacking <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />When I get some more of that thing called time I'll set it up and show you what I mean <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
Da LAN Tech

Threads Dev Moderator

Top
#232696 - 01/21/03 02:47 PM Re: Generic Header templte mod [Re: jacksonm99]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
Photopost is actually outside of Threads. I tried calling the threads library and it lets Photopost load without hanging like it did before. However it just bypasses the header. Until Photopost can read templates it is just as easy to make a html file. <br /> <br />Thought I would bring this up so people who run photopost know they need to hard code the header if they want to run this mod. <img src="/forum/images/graemlins/wink.gif" alt="" /> <br /> <br />
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#232697 - 01/21/03 03:52 PM Re: Generic Header templte mod [Re: sf49rminer]
Dalantech Offline
Junior Member

Registered: 02/11/01
Posts: 2392
Loc: Naples, Italy
Bummer, cause I hate having to re-invent the wheel when I'm scripting a web site.<br /><br />The custom error page that I have uses the table wrappers, calls the library, etc. and it is outside of Threads (I have it in web root on my server). Do you want a copy of my file?
_________________________
Da LAN Tech

Threads Dev Moderator

Top
#232698 - 01/24/03 09:40 PM Re: [6.2] Generic Header template mod [Re: jacksonm99]
Mudpuppy Offline
Journeyman

Registered: 08/16/02
Posts: 113
Loc: Sin City
How do I make my header image centered? I notice the example template references "td class="logo-left">" and "<td class="logo" width="100%" align="right">", but I'm not exactly sure how to modify these things to center my image. I've tried different combinations of code I think *might* work, but they don't.<br /><br />Thanks for the hand-holding <img src="/forum/images/graemlins/smile.gif" alt="" />

Top
#232699 - 01/25/03 01:13 AM Re: [6.2] Generic Header template mod [Re: jbiz]
Dalantech Offline
Junior Member

Registered: 02/11/01
Posts: 2392
Loc: Naples, Italy
I included a simplified version of my logo just so you could see how the templates work. The easiest way to get started is just to strip the opening and closing table tags from your current logo html and then cut and paste what's left into this template:<br /><br />
Code:
&lt;? <br />echo &lt;&lt;&lt;template<br />$tbopen   <br /> <br />//Put your logo html minus the first<br />//and last table tags after this line<br />//________________________________<br /><br /><br />//Now let's finish the template<br /><br />$tbclose<br /><br />&lt;br /&gt;<br /><br />template;<br />?&gt;<br />
<br /><br />That should get you started <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
Da LAN Tech

Threads Dev Moderator

Top
#232700 - 04/28/03 02:16 AM Re: [6.2] Generic Header template mod [Re: jacksonm99]
RandyJG Offline
Junior Member

Registered: 03/11/03
Posts: 231
Loc: Canada
Great. <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />I just added the template code that would be in the tmpl into the header itself instead.

Top
#232701 - 04/28/03 03:30 AM Re: [6.2] Generic Header template mod [Re: romka]
Dalantech Offline
Junior Member

Registered: 02/11/01
Posts: 2392
Loc: Naples, Italy
That also works provided you include <br /><br />
Code:
 <br />// Grab the tablewrapper<br />$html = new html;<br />list($tbopen,$tbclose) = $html -&gt; table_wrapper();<br /> 
<br /><br />before you try to use $tbopen and $tbclose <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
Da LAN Tech

Threads Dev Moderator

Top
#232702 - 04/28/03 03:59 AM Re: [6.2] Generic Header template mod [Re: jacksonm99]
Dalantech Offline
Junior Member

Registered: 02/11/01
Posts: 2392
Loc: Naples, Italy
This mod works for UBB Threads 6.3 <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
Da LAN Tech

Threads Dev Moderator

Top



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks